﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TreeBuilder.Contracts;
using Mvvm;
using Microsoft.Practices.Unity;
using System.Collections.ObjectModel;
using UIObjects.TreeViewInterfaces;
using MvvmTreeView;
using AbstraX.ClientInterfaces;
using AbstraX;

namespace TreeBuilder.ViewModels
{
    public class TreeBuilderViewModel : BaseViewModel<ITreeBuilderService>, ITreeBuilderViewModel
    {
        private TreeBuilderTreeView treeView;

        public TreeBuilderViewModel()
        {
            ITreeBuilderService model = IoC.Resolve<ITreeBuilderService>();
            IRootsCollection roots;

            this.Model = model;

            roots = this.Model.TreeBuilderRoots;

            treeView = new TreeBuilderTreeView(model, roots);

            treeView.ImageList = new ImageList();
        }

        public ITreeView TreeView
        {
            get 
            {
                return treeView;
            }
        }
    }
}
